]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Round workspace position
authorAlexander Mikhaylenko <exalm7659@gmail.com>
Fri, 10 Jan 2020 20:58:24 +0000 (01:58 +0500)
committerAlexander Mikhaylenko <exalm7659@gmail.com>
Fri, 10 Jan 2020 21:58:19 +0000 (02:58 +0500)
Prevent blurring when scrolling workspaces by aligning it to pixel grid,
and be consistent with app grid.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/930

js/ui/workspacesView.js

index 975dd076042741dd5febd3208313b8fe6e2fc8b1..2dd1ae490902f4866058ae7c80b8015ef5429326 100644 (file)
@@ -314,7 +314,7 @@ class WorkspacesView extends WorkspacesViewBase {
             let workspacesHeight = lastWorkspaceY - firstWorkspaceY;
 
             let currentY = firstWorkspaceY;
-            let newY = -adj.value / (adj.upper - 1) * workspacesHeight;
+            let newY = -Math.round(adj.value / (adj.upper - 1) * workspacesHeight);
 
             let dy = newY - currentY;
 
@@ -328,7 +328,7 @@ class WorkspacesView extends WorkspacesViewBase {
             let workspacesWidth = lastWorkspaceX - firstWorkspaceX;
 
             let currentX = firstWorkspaceX;
-            let newX = -adj.value / (adj.upper - 1) * workspacesWidth;
+            let newX = -Math.round(adj.value / (adj.upper - 1) * workspacesWidth);
 
             let dx = newX - currentX;